package com.viethp.mt.objects;

import org.ksoap2.serialization.SoapObject;

public class ApplyPostResponse {
	private static final String ERROR_CODE = "ErrorCode";
	private static final String MAX_BUDGET = "max_budget";
	private static final String TOTAL_BIDDER = "total_bidder";
	private ErrorCode errorCode;
	private String max_budget;
	private int total_bidder;

	public ApplyPostResponse(SoapObject result) {
		if (result != null && result.hasProperty(ERROR_CODE)) {
			this.errorCode = new ErrorCode(
					(SoapObject) result.getProperty(ERROR_CODE));
		} else {
			this.errorCode = null;
			if (result.hasProperty(MAX_BUDGET)) {
				this.max_budget = result.getProperty(
						MAX_BUDGET).toString();
			} else
				this.max_budget = "0";
			if (result.hasProperty(TOTAL_BIDDER)) {
				this.total_bidder = Integer.parseInt(result.getProperty(
						TOTAL_BIDDER).toString());
			} else
				this.total_bidder = 0;
		}
	}

	public ErrorCode getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(ErrorCode errorCode) {
		this.errorCode = errorCode;
	}

	public String getMaxBudget() {
		return this.max_budget;
	}

	public void setMaxBudget(String budget) {
		this.max_budget = budget;
	}

	public int getTotalBidder() {
		return this.total_bidder;
	}

	public void setTotalBidder(int total) {
		this.total_bidder = total;
	}
}
